home *** CD-ROM | disk | FTP | other *** search
/ PCNet 2006 March / PCnet 2006-06.3.iso / Apps / Flash / FDBuilder1160CNET.exe / Examples / Capturing.swf / scripts / frame_2 / DoAction.as
Encoding:
Text File  |  2006-04-02  |  4.8 KB  |  249 lines

  1. function fp_start()
  2. {
  3.    control_mc._visible = true;
  4.    page_mc._visible = true;
  5.    fp_goPage(1);
  6.    if(ip_LMS)
  7.    {
  8.       fscommand("LMS_Initialize");
  9.    }
  10.    if(ip_mode == 2)
  11.    {
  12.       capture_mc.isOn = true;
  13.    }
  14. }
  15. function fp_endPage()
  16. {
  17.    if(ip_LMS)
  18.    {
  19.       fscommand("LMS_SetValue","PageXCompleted=" + ip_pnum);
  20.       if(ip_pnum == ip_ptotal)
  21.       {
  22.          fscommand("LMS_DeInitialize");
  23.       }
  24.    }
  25.    if(ip_pnum == ip_ptotal)
  26.    {
  27.       fp_goTimer(false);
  28.       ip_endStat = true;
  29.       var temp = ip_endAct.split("~");
  30.       if(temp[0] == "1")
  31.       {
  32.          var temp2 = "_self";
  33.          if(temp[2] == "2")
  34.          {
  35.             temp2 = "_blank";
  36.          }
  37.          else if(temp[2] == "3")
  38.          {
  39.             temp2 = "_parent";
  40.          }
  41.          else if(temp[2] == "4")
  42.          {
  43.             temp2 = "_top";
  44.          }
  45.          getURL(temp[1],temp2);
  46.          delete temp2;
  47.       }
  48.       else if(temp[0] == "2")
  49.       {
  50.          fp_goPage(Number(temp[1]));
  51.       }
  52.       else if(temp[0] == "4")
  53.       {
  54.          replay_mc.gotoAndStop("start");
  55.       }
  56.       else if(temp[0] == "6")
  57.       {
  58.          fp_goPage(1);
  59.       }
  60.       else if(temp[0] == "5")
  61.       {
  62.          getURL("mailto:" + temp[1],"");
  63.          tArr = temp.slice(2);
  64.       }
  65.       delete temp;
  66.    }
  67. }
  68. function fp_goPage(n)
  69. {
  70.    if(n <= ip_bpage)
  71.    {
  72.       if(ip_endStat)
  73.       {
  74.          replay_mc.gotoAndStop(3);
  75.          ip_endStat = false;
  76.          fp_goTimer(true);
  77.       }
  78.       buffer_mc.closeBuff();
  79.       ip_pnum = n;
  80.       ipc_slider.setSlider(ip_pnum);
  81.       page_mc.p_onPlay = false;
  82.       page_mc.pageInit(this["ip_pset" + n]);
  83.       if(index_mc.appear)
  84.       {
  85.          index_mc.setActive();
  86.       }
  87.    }
  88.    else
  89.    {
  90.       buffer_mc.setBuff(n);
  91.    }
  92. }
  93. function fp_goNext()
  94. {
  95.    n = ip_pnum + 1;
  96.    if(n <= ip_ptotal)
  97.    {
  98.       fp_goPage(n);
  99.    }
  100. }
  101. function fp_goPrev()
  102. {
  103.    n = ip_pnum - 1;
  104.    if(n < 1)
  105.    {
  106.       n = 1;
  107.    }
  108.    fp_goPage(n);
  109. }
  110. function fp_goTimer(cond)
  111. {
  112.    page_mc.p_timeRun = cond;
  113.    ipc_play.setButton(cond);
  114.    if(ip_endStat)
  115.    {
  116.       fp_goPage(1);
  117.    }
  118. }
  119. function fp_goPageSlide(n)
  120. {
  121.    if(n != ip_pnum)
  122.    {
  123.       fp_goPage(n);
  124.    }
  125. }
  126. function fp_setControl(cond)
  127. {
  128.    control_mc.block_mc._visible = !cond;
  129. }
  130. function fp_mute(cond)
  131. {
  132.    ip_smute = cond;
  133.    ipc_mute.setButton(cond);
  134.    if(cond)
  135.    {
  136.       ip_sound.setVolume(0);
  137.    }
  138.    else
  139.    {
  140.       ip_sound.setVolume(ip_svol);
  141.    }
  142. }
  143. function fp_volume(vol)
  144. {
  145.    ip_svol = vol;
  146.    if(!ip_smute)
  147.    {
  148.       ip_sound.setVolume(ip_svol);
  149.    }
  150. }
  151. function fp_index(cond)
  152. {
  153.    ipc_index.setButton(cond);
  154.    if(cond)
  155.    {
  156.       index_mc.setOn();
  157.    }
  158.    else
  159.    {
  160.       index_mc.setOff();
  161.    }
  162. }
  163. function ip_makeText(obj, tname, d)
  164. {
  165.    var setting = obj.tset.split(",");
  166.    var link = "clip" + setting[0];
  167.    if(setting[0] == "0")
  168.    {
  169.       link = "fn_Arial";
  170.    }
  171.    obj.attachMovie(link,tname,d);
  172.    var tfield = obj[tname].tfield;
  173.    tfield.border = false;
  174.    tfield.background = false;
  175.    tfield.multiline = true;
  176.    tfield.wordWrap = true;
  177.    tfield.autoSize = "left";
  178.    tfield._width = 100;
  179.    tfield._height = 100;
  180.    tfield._x = 0;
  181.    tfield._y = 0;
  182.    var tFormat = tfield.getTextFormat();
  183.    if(setting[2] == "1")
  184.    {
  185.       tFormat.align = "left";
  186.    }
  187.    else if(setting[2] == "2")
  188.    {
  189.       tFormat.align = "center";
  190.    }
  191.    else
  192.    {
  193.       tFormat.align = "right";
  194.    }
  195.    tFormat.size = Number(setting[1]);
  196.    tFormat.color = "0x" + setting[3];
  197.    tFormat.underline = setting[4] == "1";
  198.    tfield.setNewTextFormat(tFormat);
  199.    tfield.text = obj.tval;
  200. }
  201. function ip_colBright(c, f)
  202. {
  203.    var r = c >> 16;
  204.    var g = (c & 0xFF00) >> 8;
  205.    var b = c & 0xFF;
  206.    return Math.min(Math.max(r + f,0),255) << 16 | Math.min(Math.max(g + f,0),255) << 8 | Math.min(Math.max(b + f,0),255);
  207. }
  208. function ip_colTrans(c, n)
  209. {
  210.    var col = new Object();
  211.    col.ra = 100;
  212.    col.ga = 100;
  213.    col.ba = 100;
  214.    col.aa = 100;
  215.    col.ab = 0;
  216.    col.rb = parseInt(c.substr(2,2),16) + n;
  217.    col.gb = parseInt(c.substr(4,2),16) + n;
  218.    col.bb = parseInt(c.substr(6,2),16) + n;
  219.    return col;
  220. }
  221. mask_mc._width = ip_width;
  222. mask_mc._height = ip_height;
  223. page_mc._x = mask_mc._x = index_mc._x = ip_mleft;
  224. page_mc._y = mask_mc._y = index_mc._y = ip_mtop;
  225. if(ip_w > ip_width)
  226. {
  227.    pos = (ip_w - ip_width) / 2;
  228.    mask_mc._x += pos;
  229.    page_mc._x += pos;
  230. }
  231. if(ip_h > ip_height)
  232. {
  233.    pos = (ip_h - ip_height) / 2;
  234.    mask_mc._y += pos;
  235.    page_mc._y += pos;
  236. }
  237. if(ip_cindex)
  238. {
  239.    if(ip_w < 50 || ip_h < 50)
  240.    {
  241.       ip_cindex = false;
  242.    }
  243. }
  244. ip_sound = new Sound(this);
  245. var ip_svol = ip_sound.getVolume();
  246. var ip_smute = false;
  247. var ip_timePause = false;
  248. var ip_endStat = false;
  249.